feat: add timeout parameter to click action#379
Open
3clyp50 wants to merge 1 commit intovercel-labs:mainfrom
Open
feat: add timeout parameter to click action#3793clyp50 wants to merge 1 commit intovercel-labs:mainfrom
3clyp50 wants to merge 1 commit intovercel-labs:mainfrom
Conversation
Exposes Playwright's timeout option in CLI and JSON protocol to prevent indefinite hangs when clicking elements on script-heavy or slow-loading pages. Changes: - CLI: Added --timeout flag to click command with proper arg filtering - Protocol: Added timeout validation (positive number, optional) - Types: Extended ClickCommand interface with timeout field - Actions: Pass timeout to Playwright's click() method - Tests: Added validation tests for timeout parameter - Docs: Updated SKILL.md with timeout usage example Implementation uses helper function extract_timeout() that properly parses and filters --timeout flag from CLI arguments, preventing flag leakage into text content for other commands. All tests pass (213 passed, 9 skipped).
Contributor
|
@3clyp50 is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Timeout Parameter to Click Action
Summary
Adds
timeoutparameter to theclickcommand, exposing Playwright's built-in timeout option to prevent indefinite hangs on problematic pages.Why this is Critical for AI Agents
AI agents using agent-browser get stuck indefinitely when clicking elements on:
Blockers:
Changes
CLI (
cli/src/commands.rs):agent-browser click @e1 --timeout 500 # Fail after milliseconds instead of hangingJSON Protocol (
src/protocol.ts,src/types.ts):{"action": "click", "selector": "@e1", "timeout": 500}extract_timeout()helper that properly parses and filters--timeoutflagclick({ timeout })optionskills/agent-browser/SKILL.mdwith exampleTests Added:
Testing
Breaking Changes
None. Timeout is optional and backward compatible with existing usage.